<%@ page import="com.mfp.java.testYou.core.filters.LoginFilter" %>
<%@ page import="com.mfp.java.testYou.core.AppContext" %>
<%@ page import="com.mfp.java.testYou.ui.mvc.*" %>
<%@page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="../global/global.jsp" %>


<table class="textColor padTop3 padLeft32 width65">
    <tr class="width80">
        <td class="column30">
            <a href="<%=cPath%>/">
                <img src="<%=cPath%>/testYou/resources/images/logo.png" alt="logo"/>
            </a>
        </td>
        <td class="font15">Dare to test your knowledge</td>
        <c:forEach items="<%=AppContext.getLangs()%>" var="lang">
            <td class="column1">
                <form method="POST" id="langButton${lang.id}" action="#">
                    <input type="hidden" name="<%=LoginFilter.CHANGE_LANG_PARAM%>" value="${lang.id}"/>
	                    <span class="pointerCursor" onclick="document.forms['langButton${lang.id}'].submit();">
	                        <img class="image1310px" src="<%=cPath%>${lang.img}"
                                 title="<testU:i18n>${lang.key}</testU:i18n>" alt="flag${lang.id}"/>
	                    </span>

                </form>
            </td>
        </c:forEach>
    </tr>


    <%if (!request.getRequestURI().endsWith(LoginPage.URL)) {%>
    <tr>
        <td class="padLeft30 fontUser">
			<span>
				<testU:i18n>main.user</testU:i18n>
				<%=AppContext.getUserSession(request).getUserName()%>
			</span>
        </td>

        <td class="fontSmallCaps" colspan="3" rowspan="2">
            <testU:adminOnly>
                <ul class="liHorAdmin">
                      <li>
                        <a href="<%=cPath%><%=response.encodeRedirectURL(TestsPage.URL)%>"><testU:i18n>navi.tests</testU:i18n></a>
                    </li>
                    <li>
                        <a href="<%=cPath%><%=response.encodeRedirectURL(QuestionsPage.URL)%>"><testU:i18n>navi.questions</testU:i18n></a>
                    </li>
                    <li>
                        <a href="<%=cPath%><%=response.encodeRedirectURL(UsersPage.URL)%>"><testU:i18n>navi.users</testU:i18n></a>
                    </li>
                    <li>
                        <a href="<%=cPath%><%=response.encodeRedirectURL(ResultsPage.URL)%>"><testU:i18n>navi.results</testU:i18n></a>
                    </li>
                </ul>
            </testU:adminOnly>
        </td>
    </tr>


    <tr class="fontLogout">
        <td class="padLeft30">
            <form method="post" id="logoutForm" action="#">
                <input type="hidden" name="<%=LoginFilter.LOGOUT_PARAM%>" value="true"/>
					<span class="pointerCursor" onclick="document.forms['logoutForm'].submit();">
						<testU:i18n>main.logout</testU:i18n>
					</span>
            </form>
        </td>
    </tr>
    <%}%>


</table>